package com.youshang520i.nacosserviceconsume;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * @author youshang
 */
@SpringBootApplication
@EnableFeignClients
@RestController
@RefreshScope
public class NacosServiceConsumeApplication {
    public static void main(String[] args) {
        SpringApplication.run(NacosServiceConsumeApplication.class,args);
    }


    @Value("${address}")
    public String jdbc;

    @PostConstruct
    public void init(){
        System.out.println("jdbc : "+jdbc);
    }

    @GetMapping("/init")
    public String init2(){
        return "address : "+ jdbc;
    }
}
